<?php
/****
	装饰器模式
****/
header('Content-type:text/html;charset=utf-8');

class Article{
	protected $content;
	protected $art;

	public function __construct($content){
		$this->content = $content;
	}

	public function decorate(){
		return $this->content;
	}
}

class EditArticle extends Article{

	public function __construct(Article $art){
		$this->art = $art;
	}

	public function decorate(){
		return $this->content = $this->art->decorate().'小编摘要';
	}
}	

class SEOArticle extends Article{

}	


$art = new EditArticle(new Article('haohao学习'));
echo $art->decorate();


